{include file="common/meta" title='系统' /}
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
<script src="/static/component/layui/layui.js"></script>
<script src="/static/component/pear/pear.js"></script>
<body class="pear-container">
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <form class="layui-form edit-form" method="post" action="">
            <div class="layui-tab layui-tab-brief" lay-filter="TabBrief">
                <ul class="layui-tab-title">
                    <!-- <li>系统参数</li> -->
                    <li class="layui-this">网站信息</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item  layui-show">
                        <div class="layui-form-item">
                                <label class="layui-form-label">
                                    网站名称
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="webname" value="{$data['webname']??''}" type="text"/>
                                </div>
                            </div>
                            <!--     <div class="layui-form-item"  style="margin-bottom: 0px;">
                                  <label class="layui-form-label">Logo</label>
                                  <div class="layui-input-block">
                                    <div class="layui-input-inline"  style="width: 450px;">
                                    <input type="text" name="logo" id="logo" readonly value="{$data? $data['logo'] : ''}" placeholder="请上传Logo" autocomplete="off" class="layui-input" >
                                  </div>
                                  <div class="layui-input-inline"  style="width: 200px;">
                                  <button style="float: left;" type="button" class="layui-btn" id="up_logo">上传二维码</button>
                                  </div>
                                  </div> 
                            </div>
                            <div class="layui-form-item">
                                  <label class="layui-form-label"></label>
                                  <div class="layui-input-inline"> 
                                    <img style="width:80px;"  class="layui-upload-img" id="logo_img" src="{$data['logo']?$data['logo']:''}">
                                    <p id="demoText"></p>
                                  </div>
                            </div>  -->
                            <div class="layui-form-item"  style="margin-bottom: 0px;">
                                  <label class="layui-form-label">商家图片</label>
                                  <div class="layui-input-block">
                                    <div class="layui-input-inline"  style="width: 450px;">
                                    <input type="text" name="busi_img" id="busi_img" readonly value="{$data? $data['busi_img'] : ''}" placeholder="请上传商家图片" autocomplete="off" class="layui-input" >
                                  </div>
                                  <div class="layui-input-inline"  style="width: 200px;">
                                  <button style="float: left;" type="button" class="layui-btn" id="up_busi_img">上传图片</button>
                                  </div>
                                  </div> 
                            </div>
                            <div class="layui-form-item">
                                  <label class="layui-form-label"></label>
                                  <div class="layui-input-inline"> 
                                    <img style="width:80px;"  class="layui-upload-img" id="busi_img_img" src="{$data['busi_img']?$data['busi_img']:''}">
                                    <p id="demoText"></p>
                                  </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">
                                    小程序名称
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="wxname" value="{$data['wxname']??''}" type="text"/>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">
                                    appid
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="appid" value="{$data['appid']??''}" type="text"/>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">
                                    appsecret
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="appsecret" value="{$data['appsecret']??''}" type="text"/>
                                </div>
                            </div>
                    </div>
                </div>  
                <div class="layui-input-block" style="min-height: 80px;">
                    <button type="submit" class="pear-btn pear-btn-primary">保存</button>
                    <button type="reset" class="pear-btn">重置</button>
                </div>
        </form>    
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'jquery', 'uploads'], function() {
        let form = layui.form;
        let upload = layui.upload;
        let $ = layui.jquery;
        upload.render({
            elem: '#up_logo'
            ,url: "{:url('/admin/config/upload')}"
            ,auto: true //选择文件后自动上传
            // ,bindAction: '#LAY-user-front-submit'
            ,field:'image'
            ,accept: 'images'   //指定允许上传时校验的文件类型
            ,method: 'post'
            ,acceptMime: 'image/*'
            ,multiple: false 
            ,done: function(res){  //执行上传请求后的回调。返回三个参数
              console.log(res);
              $("#logo").val(res.data)
              $("#logo_img").attr('src',res.data)
              layer.msg('上传成功', {
                        offset: '15px'
                        ,icon: 1
                        ,time: 1000
                      });
            },error:function(res){

            }
        });
        upload.render({
            elem: '#up_busi_img'
            ,url: "{:url('/admin/config/upload')}"
            ,auto: true //选择文件后自动上传
            // ,bindAction: '#LAY-user-front-submit'
            ,field:'image'
            ,accept: 'images'   //指定允许上传时校验的文件类型
            ,method: 'post'
            ,acceptMime: 'image/*'
            ,multiple: false 
            ,done: function(res){  //执行上传请求后的回调。返回三个参数
              console.log(res);
              $("#busi_img").val(res.data)
              $("#busi_img_img").attr('src',res.data)
              layer.msg('上传成功', {
                        offset: '15px'
                        ,icon: 1
                        ,time: 1000
                      });
            },error:function(res){

            }
        });
        
        // form.on('radio(type)', function(data){
        //     if(data.value==1){
        //         $("#oss").hide();
        //         $("#qiniu").hide();
        //     }
        //     if(data.value==2){
        //         $("#oss").show();
        //         $("#qiniu").hide();
        //     }
        //     if(data.value==3){
        //         $("#qiniu").show();
        //         $("#oss").hide();
        //     }
        // });  
    })
    </script>
<script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

    var ue = UE.getEditor('about',{ zIndex: 10});
</script>
</body>
</html>
